<template>
  <el-dialog
    :visible.sync="isShow"
    destroy-on-close
    :title="title"
    width="90%"
    top="10px"
    :close-on-click-modal="false"
  >
    <el-form ref="form" v-loading="loading" :model="fields" label-width="120px">
      <img src="">
    </el-form>
    <div class="page-title border-left-color-blue flex align-center justify-between margin-top">
      <div>审批日志</div>
    </div>
    <vxe-table
      ref="table"
      border
      size="mini"
      highlight-current-row
      :data="fields.detailList"
    >
      <vxe-table-column field="code" title="审批时间" align="center" show-overflow />
      <vxe-table-column field="name" title="审批人" width="130px" align="center" />
      <vxe-table-column field="specs" title="审批结果" show-overflow width="100" align="center" />
    </vxe-table>
  </el-dialog>
</template>

<script>
export default {
  components: {
  },
  props: {
    value: {
      type: Object,
      default: () => Object.create({})
    }
  },
  data() {
    let that = this;
    return {
      loading: false,
      isShow: true,
      goodsPage:null,
      dialog: false,
      fields: {
        id:"1",
        supplierId:"2",
        supplierName:"上海宝钢钢铁有限公司",
        purchaseDate:"2022-01-19",
        merchandiser:"张柳",
        ifInvoice:true,
        orderMoney:"2,900.00",
        orderStatus:"0",
        orderStatusName:"编辑中",
        comment:"备注234",
        stockInOrderCode:"STI20220106009",
        auditReason:"",
        detailList:[
            {
                "id": "1",
                "name": "加工钢材",
                "code": "jggc",
                "typeId": "bedcc51eab293ba311b952b8cee7f542",
                "typeName": "钢材",
                "specs": "规格1",
                "enabled": true,
                "unit": "件",
                "unitType": "jj",
                "hasSendNumber":5,
                "hasReciveMoney":100,
                "purchasePrice": "120.56",
                "salesPrice": "129.56",
                "comment": "",
                "bomList": [],
                "number": 0,
                "price": "129.56",
                "totalMoney": "1000"
            },
            {
                "id": "2",
                "name": "加工钢材2",
                "code": "jggc2",
                "typeId": "bedcc51eab293ba311b952b8cee7f542",
                "typeName": "钢材",
                "specs": "规格2",
                "enabled": true,
                "unit": "件",
                "unitType": "jj",
                "purchasePrice": "120.56",
                "salesPrice": "129.56",
                "hasSendNumber":5,
                "hasReciveMoney":100,
                "comment": "",
                "bomList": [],
                "number": 0,
                "price": "129.56",
                "totalMoney": "1000"
            }
        ],
        fileList:[
          {
            name:"采购文件1.doc",
            createTime:"2022-01-09",
            creator:"张震"
          }
        ]
      },
      ifInvoiceList:[{label:"否",value:false},{label:"是",value:true}],
      contractList:[ {
            id:"1",
            name:"钢材销售合同",
            code:"0100010101",
            customerId:"1",
            tax:"3%",
            taxMoney:"360",
            hasReciveMoney:"10000",
            customerName:"中国建筑",
            progress:"yqd",
            money:"12057.256",
            signDate:"2021-05-15",
            enableDate:"2021-05-15",
            deliverDate:"2021-05-15",
            salesOwner:"李胜利",
            comment:"一定要保质保量交付",
            fileList:[
              {name:"合同原件.doc",url:"http:123.com",createTime:"2021-05-15",creator:"孙晓伟"},
              {name:"合同附件.xls",url:"http:123.com",createTime:"2021-05-15",creator:"孙晓伟"}
            ]
          },{
            id:"2",
            name:"钣金销售合同",
            code:"0100010102",
            customerId:"1",
            tax:"3%",
            taxMoney:"360",
            hasReciveMoney:"10000",
            customerName:"中国建筑",
            progress:"yqd",
            money:"12057.256",
            signDate:"2021-05-15",
            enableDate:"2021-05-15",
            deliverDate:"2021-05-15",
            salesOwner:"李胜利",
            comment:"一定要保质保量交付",
            fileList:[
              {name:"合同原件.doc",url:"http:123.com",createTime:"2021-05-15",creator:"孙晓伟"},
              {name:"合同附件.xls",url:"http:123.com",createTime:"2021-05-15",creator:"孙晓伟"}
            ]
          }],
      customerList: [ {
        id:"1",
        name:"中国建筑",
        simpleName:"中国建筑",
        person:"张三",
        type:"s",
        phone:15029666666,
        address:"北京默默地址",
        enabled:true,
        taxNo:"15784574SGDFS85",
        bankName:"中国工商银行一个支行",
        bankNo:61525898565878547,
        code:"21-02-04",
        comment:""
      }, {
        id:"2",
        name:"第三公司",
        simpleName:"第三公司",
        person:"张三",
        type:"sc",
        phone:15029666666,
        address:"北京默默地址",
        enabled:true,
        taxNo:"15784574SGDFS85",
        bankName:"中国工商银行一个支行",
        bankNo:61525898565878547,
        code:"21-02-04",
        comment:"备注信息"
      }, {
        id:"3",
        name:"第二公司",
        simpleName:"第二公司",
        type:"c",
        person:"张三",
        phone:15029666666,
        address:"北京默默地址",
        enabled:true,
        taxNo:"15784574SGDFS85",
        bankName:"中国工商银行一个支行",
        bankNo:61525898565878547,
        code:"21-02-04",
        comment:""
      },],
      unitTypeList:[{label:"计件",value:"jj"},{label:"计重",value:"jz"},{label:"计容",value:"jr"}],
      title: "查看详情"
    };
  },
  watch: {
    isShow: function() {
      this.$emit("input", null);
    }
  },
  created() {
      this.title = "审核详情";
  },
  computed: {

  },
  methods: {
    //驳回
    rejectPurchase(id) {
      this.loading = true;
      if (this.fields.auditReason&&this.fields.auditReason.length >= 128) {
          this.$notify({
            title: "审核备注输入过长",
            type: "error",
            duration: 2500
          });
          this.loading = false;
        } else {
          this.$notify({
            title: "驳回成功",
            type: "success",
            duration: 2500
          });
          this.loading = false;
          this.isShow = false;
        }
    },
    //审核通过
    auditPurchase(data) {
      this.loading = true;
      this.$notify({
        title: "审核通过",
        type: "success",
        duration: 2500
      });
      this.loading = false;
      this.isShow = false;
    },
    
  }
};
</script>

<style scoped>

</style>
